package vn.edu.saigontech.ncms.model.studying;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import vn.edu.saigontech.ncms.model.BaseEntity;
import vn.edu.saigontech.ncms.model.info.Offering;
import vn.edu.saigontech.ncms.model.info.OfferingMember;

@Entity
@Table(name = "ncms_absence_record")
@SuppressWarnings("serial")
public class AbsenceRecord extends BaseEntity {
	@ManyToOne()
	@JoinColumn(name = "offering_member_id", nullable = false)
	private OfferingMember offeringMember;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "offering_id", nullable = false)
	private Offering offering;

	@Column(name = "absent_days")
	private int numOfAbsentDays;

	@Column(name = "contacting_date")
	private Date contactingDate;

	@Column(name = "reason")
	private String reason;

	public int getNumOfAbsentDays() {
		return numOfAbsentDays;
	}

	public void setNumOfAbsentDays(int numOfAbsentDays) {
		this.numOfAbsentDays = numOfAbsentDays;
	}

	public Date getContactingDate() {
		return contactingDate;
	}

	public void setContactingDate(Date contactingDate) {
		this.contactingDate = contactingDate;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public OfferingMember getOfferingMember() {
		return offeringMember;
	}

	public void setOfferingMember(OfferingMember offeringMember) {
		this.offeringMember = offeringMember;
	}

	public Offering getOffering() {
		return offering;
	}

	public void setOffering(Offering offering) {
		this.offering = offering;
	}
}